﻿ECHO This is taken from MSDN http://msdn.microsoft.com/en-us/library/ee538587.aspx

Echo Off
SET SPLANGEXT=cs
SET SPMETALGENDIR=.\SPMetalGeneratedCode

Echo Backing up previous version of generated code ... 
IF NOT EXIST %SPMETALGENDIR% MkDir %SPMETALGENDIR%
IF EXIST SiteEntities.%SPLANGEXT% xcopy /Y/V SiteEntities.%SPLANGEXT% %SPMETALGENDIR%

Echo Generating code ...
REM SPMetal /web:http://win2k8 /code:SiteEntities.%SPLANGEXT% /parameters:SPMetal.xml /namespace:LinqConsole
REM http://win2k8:4249/default.aspx

SPMetal /web:http://win2k8 /code:SiteEntities.%SPLANGEXT% /namespace:LinqConsole.HomePage
SPMetal /web:http://win2k8:4249 /code:SiteEntities.%SPLANGEXT% /namespace:MySiteEntities.AdminSite

